﻿<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="sec" uri="http://www.springframework.org/security/tags" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>

<%@ taglib prefix="sec" uri="http://www.springframework.org/security/tags" %>
<sec:authentication property="principal" var="currentPrincipal" scope="page" />

<fmt:setBundle basename="ApplicationMessage" />
<fmt:setLocale value="zh_CN" />

<!DOCTYPE html>
<html lang="zh-CN">
<head>

  <%@ include file="/WEB-INF/include/meta.jsp"%>
  <%@ include file="/WEB-INF/include/css.jsp"%>
  
</head>

<body>

  <%@ include file="/WEB-INF/include/header.jsp"%>
  <%@ include file="/WEB-INF/include/menu.jsp"%>
  
  <div class="container main-content">
  
    <div class="panel panel-default x-panel x-panel-layout">
  
      <div class="panel-heading">
        <ol class="breadcrumb">
          <li><a href="${ctx.host}/credit">积分管理</a></li>
          <li class="active">订单管理</li>
        </ol>
      </div>
      
      <div class="panel-body">
      
        <div class="col-xs-2 x-panel-layout-left no-horizontal-padding">
          <%@ include file="/WEB-INF/include/submenu.jsp"%>
        </div>
        
        <div class="col-xs-10 x-panel-layout-right">
          
          <div class="x-breadcrumb-wrapper">
            <div class="x-breadcrumb clearfix">
              <h2><i class="glyphicon glyphicon-fire"></i>&nbsp;&nbsp;<span>订单管理&nbsp;-&nbsp;订单详情</span></h2>
            </div>
          </div>
          
          <div class="x-breadcrumb-wrapper top-margin-20">
          
            <!-- tabs -->
            <ul class="nav nav-pills x-breadcrumb-nav ajax-tab" data-content="#order-content" data-operation="#order-operations">
              <li class="pull-left active">
                <a id="orderProfile" href="${ctx.host}/${param.type}-orders/${order.id }/view" data-toggle="tab" data-target="#order-profile">基本信息</a>
              </li>
              <li class="pull-left">
                <a id="orderActivity" href="${ctx.host}/${param.type}-credit-orders/${order.id}/product?view=true" data-toggle="tab" data-target="#order-activity">产品信息</a>
              </li>
            </ul>
            
            <div id="order-operations" class="tab-operation pull-right">
            </div>
            
          </div>
          
          <div id="order-content" class="tab-content ajax-tab-content">
          
            <div class="tab-pane fade active in" id="order-profile" style="min-height: 160px;">
              
              <div class="form-horizontal">
              
                <div class="form-horizontal">
              
                <div class="form-group">
                  <label class="col-xs-2 control-label">下单用户：</label>
                  <div class="col-xs-3">
                    <p class="form-control-static">${order.user.name}（${order.user.wechat.code}）<br>
                    ${order.user.mobile}</p>
                  </div>
                  
                  <label class="col-xs-2 control-label">学员：</label>
                  <div class="col-xs-3">
                    <p class="form-control-static">${order.student.name}</p>
                  </div>
                </div>
                
                <div class="form-group">
                  <label class="col-xs-2 control-label">订单单价：</label>
                  <div class="col-xs-3">
                    <p class="form-control-static">${order.unitPrice}</p>
                  </div>
                 
                  <label class="col-xs-2 control-label">订单数量：</label>
                  <div class="col-xs-3">
                    <p class="form-control-static">${order.amount}</p>
                  </div>
                  
                </div>
                
                <div class="form-group">
                  <label class="col-xs-2 control-label">订单状态：</label>
                  <div class="col-xs-3">
                    <p class="form-control-static">${order.status.description}</p>
                  </div>
                  <label class="col-xs-2 control-label">下单时间：</label>
                  <div class="col-xs-3">
                    <p class="form-control-static">${order.createTime}</p>
                  </div>
                  
                 </div>
                 <c:if test="${empty order.couponId}">
	                 <div class="form-group">
	                  <label class="col-xs-2 control-label">地址信息：</label>
	                  <div class="col-xs-8">
	                    <p class="form-control-static">${order.contactName}（${order.contactPhone}）<br></p>
	                    <p class="form-control-static">省：${order.province}&nbsp;&nbsp;市：${order.city}&nbsp;&nbsp;区/县：${order.region}&nbsp;&nbsp;-&nbsp;&nbsp;${order.address}<br></p>
	                  </div>
	                
	                </div>
                </c:if>
              </div>
                
              </div>
            
            </div>
            
          </div>
          
          
        </div>
        
      </div>
      
    </div>
    
  </div>

  <%@ include file="/WEB-INF/include/script.jsp"%>
  
  <d:resource root="${ctx.resource}/build" type="script" src="js/page/credit/order/credit-order-view.js">
    <script type="text/javascript">
      require(['page/credit/order/credit-order-view'],function(page){
          page.init();
      })
    </script>
  </d:resource>

</body>

</html>